import _ from 'loadsh';
import printMe from "./print";

/**
 * 创建div容器
 * @returns {HTMLDivElement}
 */
function component() {
    const element = document.createElement('div');
    element.classList.add('container');
    //loadsh
    var title = document.createElement('div');
    // lodash 是由当前 script 脚本 import 导入进来的
    title.innerHTML = _.join(['Hello', 'webpack'], ' ');
    title.classList.add('title');
    element.appendChild(title)
    //按钮
    const btn = document.createElement("div")
    btn.innerText = "点击打印"
    btn.onclick = printMe;
    btn.classList.add("btn")
    element.appendChild(btn)

    return element;
}

document.body.appendChild(component());
